﻿<UserControl
  x:Class="Renren.Controls.LoadingBox"
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  mc:Ignorable="d"
  FontFamily="{StaticResource PhoneFontFamilyNormal}"
  FontSize="{StaticResource PhoneFontSizeNormal}"
  Foreground="{StaticResource PhoneForegroundBrush}">

  <Grid x:Name="LayoutRoot">
    <StackPanel Orientation="Horizontal">
      <Grid Margin="8,0,0,0" Width="50" Height="50">
        <Image x:Name="Arrow" Width="50" Height="50" Source="/Images/pulldown_arrow.png">
          <Image.RenderTransform>
            <RotateTransform x:Name="FlipTransform" CenterX="25" CenterY="25" Angle="180"/>
          </Image.RenderTransform>
          <Image.Resources>
            <Storyboard x:Name="FlipDown">
              <DoubleAnimation Storyboard.TargetName="FlipTransform"
                               Storyboard.TargetProperty="Angle"
                               From="0" To="180" Duration="0:0:0.2"/>
            </Storyboard>
            <Storyboard x:Name="FlipUp">
              <DoubleAnimation Storyboard.TargetName="FlipTransform"
                               Storyboard.TargetProperty="Angle"
                               From="180" To="0" Duration="0:0:0.2"/>
            </Storyboard>
          </Image.Resources>
        </Image>
        <Image x:Name="SpinningBall" Source="/Images/spinning_ball.png" Width="36" Height="36">
          <Image.RenderTransform>
            <RotateTransform x:Name="SpinTransform" CenterX="18" CenterY="18"/>
          </Image.RenderTransform>
          <Image.Resources>
            <Storyboard x:Name="Spin">
              <DoubleAnimation Storyboard.TargetName="SpinTransform"
                               Storyboard.TargetProperty="Angle"
                               From="0" To="360" Duration="0:0:1"
                               RepeatBehavior="Forever"/>
            </Storyboard>
          </Image.Resources>
        </Image>
      </Grid>
      <TextBlock x:Name="TextBlock" Margin="10,0,0,0"
                 Text="下拉可以刷新"
                 VerticalAlignment="Center" FontSize="26"
                 Style="{StaticResource PhoneTextExtraLargeStyle}"
                 Foreground="{StaticResource PhoneAccentBrush}" />
    </StackPanel>
  </Grid>
</UserControl>
